<?php
/**
 * @return
 * @author 朱乐斌
 * @date
 */

namespace app\validate;

use think\Validate;

class UserValidate extends Validate
{

    // 定义验证规则
    protected  $rule = [
        'username' =>  'require|mobile',
        'password' => 'require|length:6,16'
    ];

    // 定义验证提示
    protected $message = [
        'username.require' => '用户名不能为空',
        'username.mobile' => '账号格式不正确',
    ];

    // 定义验证场景
    protected $scene = [
        'checkLogin' => ['username','password']
    ];

}